//
//  UIImageView+ASK.m
//  换换圈
//
//  Created by 艾柯斯 on 14-12-1.
//  Copyright (c) 2014年 艾柯斯. All rights reserved.
//

#import "UIImageView+ASK.h"
#import "UIImageView+WebCache.h"

@implementation UIImageView (ASK)


- (void)memberImageView {
    [self round];
    self.clipsToBounds = YES;
    self.contentMode = UIViewContentModeScaleAspectFill;
}

-(void)productImageView {
    self.clipsToBounds = YES;
    self.contentMode = UIViewContentModeScaleAspectFill;
}

-(void)ShowImageView
{
//    self.backgroundColor=[UIColor redColor];
    self.clipsToBounds = YES;
    self.contentMode = UIViewContentModeScaleAspectFit;
}

- (void)downloadMemberImageUrl:(NSString*)url {
    UIImage* defaultImage = [UIImage imageNamed:@"member_default"];
    [ImageUtil downloadImage:url placeholder:defaultImage imageView:self];
}

- (void)downloadProductImageUrl:(NSString*)url {
    
    self.clipsToBounds = YES;
    if(![url isKindOfClass:[NSString class]] || [url isEmpty]) {
        self.image = [UIImage imageNamed:@"product_default"];
    }else {
        [self setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"product_loading"] options:SDWebImageLowPriority | SDWebImageRetryFailed];
    }
}




@end
